//导入 mongoose
const mongoose = require('mongoose');

//导入 db.js
const db = require("./db/db");
const BookModel = require('./db/models/BookModel');

//调用 db 函数
db(
  () => {
    BookModel.find((err, data) => {
      if(err) throw err;
      console.log(data);
    })
  },
  () => {
    console.log('连接失败~~~');

  }
);
